package com.mofum.cloud.core.model.impl;

import com.mofum.cloud.core.model.Algorithm;
import com.mofum.cloud.core.model.Instruction;
import com.mofum.cloud.core.model.RuntimeContext;
import com.mofum.cloud.core.model.RuntimeContextAware;

import java.math.BigInteger;

/**
 * 标准指令实现
 *
 * @author yumi@omuao.com
 */
public class StandardInstructionImpl implements Instruction, RuntimeContextAware {

    /**
     * 指令ID
     */
    private BigInteger id;

    /**
     * 算法
     */
    private Algorithm algorithm;

    /**
     * 机器码
     */
    private BigInteger machineCode;

    /**
     * 指令名称
     */
    private String name;

    /**
     * 运行时上下文
     */
    private RuntimeContext runtimeContext;


    public StandardInstructionImpl() {
        this.setName(StandardInstructionImpl.class.getName());
    }

    @Override
    public BigInteger getId() {
        return id;
    }

    @Override
    public void setId(BigInteger id) {
        this.id = id;
    }

    @Override
    public Algorithm getAlgorithm() {
        return algorithm;
    }

    @Override
    public void setAlgorithm(Algorithm algorithm) {
        this.algorithm = algorithm;
    }

    @Override
    public BigInteger getMachineCode() {
        return machineCode;
    }

    @Override
    public void setMachineCode(BigInteger machineCode) {
        this.machineCode = machineCode;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public RuntimeContext getRuntimeContext() {
        return runtimeContext;
    }

    @Override
    public void setRuntimeContext(RuntimeContext runtimeContext) {
        this.runtimeContext = runtimeContext;
    }
}
